package com.kason.producer;

import com.kason.framework.Protocol;
import com.kason.framework.Remote;
import com.kason.framework.factory.ProtocolFactory;
import com.kason.framework.regester.LocalRegester;
import com.kason.framework.regester.ZookeeperRegester;
import com.kason.producer.api.KasonInterface;
import com.kason.producer.impl.KasonProducer;

/**
 * @author 卢清波
 * @date 2021/2/19 18:37
 */
public class Producer
{
    public static void main(String[] args)
    {
        // 1. 注册服务
        // 2. 本地注册
        // 3. 启动tomcat

        // 注册远程服务
        Remote remote = new Remote("localhost",8086);
        ZookeeperRegester.regist(KasonInterface.class.getName(),remote);
        // 实现类
        LocalRegester.regist(KasonInterface.class.getName(), KasonProducer.class);
        // 启动协议，dubbo,tomcat
        Protocol protocol = ProtocolFactory.getProtocol();
        protocol.start(remote);


    }
}
